package com.wangdong.rxjavaandroid.javaobserver.demo2;

import java.util.Observable;

/**
 * 老师 定义为被观察者 继承 java.util.Observable
 */
public class Teacher$Observable extends Observable {

    private String teacherNum = "110";

    public String getTeacherNum() {
        return teacherNum;
    }

    public void setTeacherNum(String teacherNum) {
        this.teacherNum = teacherNum;

        if (teacherNum != null && !teacherNum.equals(this.teacherNum)) {
            this.teacherNum = teacherNum;
            //通知数据改变了
            setChanged();
        }
        //通过此方法修改teacherNum使用调用 通知
        notifyObservers();
    }
}
